package com.myspringsecurity.controller;

import org.springframework.security.access.prepost.PreAuthorize;
import org.springframework.security.core.Authentication;
import org.springframework.security.core.context.SecurityContext;
import org.springframework.security.core.context.SecurityContextHolder;
import org.springframework.web.bind.annotation.*;

/**
 * @author ：Q大侠
 * @date ：Created in 2022/10/31 14:47
 * @description：
 * @modified By：
 * @version:
 */
@RestController
public class UserQuan {

    @GetMapping("/user/query")
    @ResponseBody
    @PreAuthorize(value = "hasAnyAuthority('/user/query')")
    public String query(){
        return "user::query";
    }

    @GetMapping("/user/delete")
    @ResponseBody
    @PreAuthorize(value = "hasAnyAuthority('/user/delete')")
    public String delete(){
        return "user::delete";
    }

    @GetMapping("/user/update")
    @ResponseBody
    @PreAuthorize(value = "hasAnyAuthority('/user/update')")
    public String update(){
        return "user::update";
    }

    @GetMapping("/user/insert")
    @PreAuthorize(value = "hasAnyAuthority('/user/insert')")
    @ResponseBody
    public String insert(){
        return "user::insert";
    }

    @GetMapping("/user/export")
    @ResponseBody
    @PreAuthorize(value = "hasAnyAuthority('/user/export')")
    public String export(){
        return "user::export";
    }

}
